<?php

	require_once ('sql.php');

	echo'<form name="addshowform" method="post"><table width="100%">';

	$message = NULL; // Create an empty new variable.

	$query = "SELECT s_id, name, season, year, broadcast FROM series WHERE broadcast=0 ORDER BY name ASC";
	$result = @mysql_query ($query); // Run the query.
	$num = mysql_num_rows ($result); // How many results are there?
	
	if ($num >= 1) { // If it ran OK, display the records.
				
					// Fetch and print all the records.
			while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
				
				echo "
				<tr><td><input type=\"checkbox\" name=\"addnew\" value=\"$row[0]\" />  [$row[2] $row[3]] $row[1]</td></tr>";
			}
		
		mysql_free_result ($result); // Free up the resources.
		
	} else { // If it did not run OK.
		echo '<p>Whoops.</p><p>' . mysql_error() . '</p>';
	}
	
	echo '</table>
	<div align="center"><input type="button" value="Add Shows" onclick="addShowQuery();" />&nbsp;&nbsp;&nbsp;&nbsp;
		<input type="button" value="Cancel" onclick="showList();" /></div><br><br>
	
	</form><!-- End of Form -->';


?>